package com.heng.service.Impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.heng.dao.entity.coupon.CouponTemplateDO;
import com.heng.dao.mapper.CouponTemplateMapper;
import com.heng.service.CouponTemplateService;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class CouponTemplateServiceImpl extends ServiceImpl<CouponTemplateMapper, CouponTemplateDO> implements CouponTemplateService {

    @Override
    public List<CouponTemplateDO> getByShopNumber(Long shopNumber) {
        return baseMapper.selectByShopNumber(shopNumber);
    }

    @Override
    public List<CouponTemplateDO> getValidTemplates() {
        return baseMapper.selectValidTemplates();
    }

    @Override
    public IPage<CouponTemplateDO> pageQuery(Integer pageNum, Integer pageSize) {
        return baseMapper.selectPage(new Page<>(pageNum, pageSize), null);
    }
}